package psn.kiko.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 *Execute the annotated method with a fixed period in milliseconds between the end of
 * the last invocation and the start of the next
 */
@Component
@Slf4j
public class FixedDelayTask{
	//上次调用结束5秒后开始下一次调用
	@Scheduled(fixedDelay=1000*5,initialDelay=1000*5)
	public void task(){
		log.debug("fixedDelay指定的定时任务{}",LocalDateTime.now());
	}
}
